package com.education.basic.resource;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.yunshangwoniu.core.utils.Logger;

/**
 * 课程枚举
 * @author wottui
 */
public enum Courses
{
	/*计算机科学与技术专业的必修课*/
	C_YU_YAN("0801","C语言",Major.JSJKXYJS,CoursesType.BI_XIU),
	DAXUE_YINGYU("0802","大学英语",Major.JSJKXYJS,CoursesType.BI_XIU),
	ZHUANYE_YINGYU("0803","专业英语",Major.JSJKXYJS,CoursesType.BI_XIU),
	GAILV_TONGJI("0804","概率统计",Major.JSJKXYJS,CoursesType.BI_XIU),
	LISHAN_SHUXUE("0805","离散数学",Major.JSJKXYJS,CoursesType.BI_XIU),
	DIANLU("0806","电路",Major.JSJKXYJS,CoursesType.BI_XIU),
	MONI_DIANZI("0807","模拟电子",Major.JSJKXYJS,CoursesType.BI_XIU),
	SHUZI_DIANZI("0808","数字电子",Major.JSJKXYJS,CoursesType.BI_XIU),
	SHUJU_JIEGOU("0809","数据结构",Major.JSJKXYJS,CoursesType.BI_XIU),
	CAOZUO_XITONG("0810","操作系统",Major.JSJKXYJS,CoursesType.BI_XIU),
	BIYI_YUANLI("0811","编译原理",Major.JSJKXYJS,CoursesType.BI_XIU),
	JISUANJI_WANGLUO("0812","计算机网络",Major.JSJKXYJS,CoursesType.BI_XIU),
	SHUJUKU_YUANLI("0813","数据库原理",Major.JSJKXYJS,CoursesType.BI_XIU),
	RUANJIAN_GONGCHENG("0814","软件工程",Major.JSJKXYJS,CoursesType.BI_XIU),
	HUIBIAN_YUYAN("0815","汇编语言",Major.JSJKXYJS,CoursesType.BI_XIU),
	C_CHENGXUSHEJI("0816","C++程序设计",Major.JSJKXYJS,CoursesType.BI_XIU),
	JIKOU_JISHU("0817","接口技术",Major.JSJKXYJS,CoursesType.BI_XIU),
	JAVA("0818","Java",Major.JSJKXYJS,CoursesType.BI_XIU),
	VC_("0819","VC++",Major.JSJKXYJS,CoursesType.BI_XIU),
	JISUANJI_BINGDU_FENXI("0820","计算机病毒分析",Major.JSJKXYJS,CoursesType.BI_XIU),
	WANGLUO_YU_FANGHU("0821","网络攻击与防护",Major.JSJKXYJS,CoursesType.BI_XIU),
	MIMA_YINGYONG_HUO_WANGLUO_YOUXI_LILUN("0822","密码学应用或网络游戏理论",Major.JSJKXYJS,CoursesType.BI_XIU),
	YOUXI_SHEJI("0823","游戏设计",Major.JSJKXYJS,CoursesType.BI_XIU),
	SANWEI_DONGHUA("0824","三维动画",Major.JSJKXYJS,CoursesType.BI_XIU),
	
	/*水土工程专业的必修课*/
	SHUXUE("0101","数学",Major.STGC,CoursesType.BI_XIU),
	GONGCHENG_LIXUE("0102","工程力学",Major.STGC,CoursesType.BI_XIU),
	SHUILIGONGCHENG_ZHITU("0103","水利工程制图",Major.STGC,CoursesType.BI_XIU),
	SHUILIXUE("0104","水力学",Major.STGC,CoursesType.BI_XIU),
	DIZHI("0105","地质",Major.STGC,CoursesType.BI_XIU),
	TULIXUE("0106","土力学",Major.STGC,CoursesType.BI_XIU),
	JIANZHU_CAILIAO("0107","建筑材料",Major.STGC,CoursesType.BI_XIU),
	SHUITUGANGJING_HUNLITU_JIEGOU("0108","水工钢筋混凝土结构",Major.STGC,CoursesType.BI_XIU),
	SHUIZIYUANGUANLI("0109","水资源管理",Major.STGC,CoursesType.BI_XIU),
	LILUN_LIXUE("0110","理论力学",Major.STGC,CoursesType.BI_XIU),
	CAILIAO_LIXUE("0111","材料力学",Major.STGC,CoursesType.BI_XIU),
	SHUITU_JIANZHUWU("0112","水工建筑物",Major.STGC,CoursesType.BI_XIU),
	SHUIWEN_XUE("0113","水文学",Major.STGC,CoursesType.BI_XIU),
	CE_LIANG("0114","测量",Major.STGC,CoursesType.BI_XIU),
	
	/*水利水电工程的必修课*/
	SHUITU_JIANZHUWU_SLSDGC("0201","水工建筑物",Major.SLSDGC,CoursesType.BI_XIU),
	GANGJIN_HUNLITU_JIEGOU("0202","钢筋混凝土结构",Major.SLSDGC,CoursesType.BI_XIU),
	JINGLIXUE("0203","静力学",Major.SLSDGC,CoursesType.BI_XIU),
	DONGLIXUE("0204","动力学",Major.SLSDGC,CoursesType.BI_XIU),
	TULIXUE_SLSDGC("0205","土力学",Major.SLSDGC,CoursesType.BI_XIU),
	JIEGOULIXUE("0206","结构力学",Major.SLSDGC,CoursesType.BI_XIU),
	BANGZHANYUSHUILIXUE("0207","泵站与水电站",Major.SLSDGC,CoursesType.BI_XIU),
	SHUIWEN_YU_SHUIWENJISUAN("0208","水文与水文计算",Major.SLSDGC,CoursesType.BI_XIU),
	GONGCHENG_CELIANG("0209","工程测量",Major.SLSDGC,CoursesType.BI_XIU),
	SHUILIXUE_SLSDGC("0210","水力学",Major.SLSDGC,CoursesType.BI_XIU),
	GAOSHU("0211","高数",Major.SLSDGC,CoursesType.BI_XIU),
	DAWU("0212","大物",Major.SLSDGC,CoursesType.BI_XIU),
	ZHUANYE_YINGYUE("0213","专业英语",Major.SLSDGC,CoursesType.BI_XIU),
	
	/*环境工程的必修课*/
	WUJI_HUAXUE("0301","无机化学",Major.HJGC,CoursesType.BI_XIU),
	FENXI_HUAXUE("0302","分析化学",Major.HJGC,CoursesType.BI_XIU),
	WULI_HUAXUE("0303","物理化学",Major.HJGC,CoursesType.BI_XIU),
	YOUJI_HUAXUE("0304","有机化学",Major.HJGC,CoursesType.BI_XIU),
	HUANJIN_HUAXUE("0305","环境化学",Major.HJGC,CoursesType.BI_XIU),
	HUANJING_GONGCHENG_YUANLI("0306","环境工程原理",Major.HJGC,CoursesType.BI_XIU),
	HUANJING_KEXUE_GAILUN("0307","环境科学概论",Major.HJGC,CoursesType.BI_XIU),
	HUANJING_GONGCHENG_SHEJI_JICHU("0308","环境工程设计基础",Major.HJGC,CoursesType.BI_XIU),
	HUANJING_GUIHUA_YU_GUANLI("0309","环境规划与管理",Major.HJGC,CoursesType.BI_XIU),
	SANFEI_ZHILI("0310","三废治理",Major.HJGC,CoursesType.BI_XIU),
	
	/*机械工程及自动化必修课*/
	LILUN_LIXUE_JXGCJZDH("0401","理论力学",Major.JXGCJZDH,CoursesType.BI_XIU),
	CAILIAO_LIXUE_JXGCJZDH("0402","材料力学",Major.JXGCJZDH,CoursesType.BI_XIU),
	LIUTILIXUE_YU_YEYACHUANDONG("0403","流体力学与液压传动",Major.JXGCJZDH,CoursesType.BI_XIU),
	DIANLU_FENXI("0404","电路分析",Major.JXGCJZDH,CoursesType.BI_XIU),
	SHUZI_DIANLU("0405","数字电路",Major.JXGCJZDH,CoursesType.BI_XIU),
	MONI_DIANLU("0406","模拟电路",Major.JXGCJZDH,CoursesType.BI_XIU),
	GONGCHENG_TUXUE("0407","工程图学",Major.JXGCJZDH,CoursesType.BI_XIU),
	JIXIE_YUANLI("0408","机械原理",Major.JXGCJZDH,CoursesType.BI_XIU),
	JIXIE_SHEJI("0409","机械设计",Major.JXGCJZDH,CoursesType.BI_XIU),
	GONGCHENG_CAILIAO("0410","工程材料",Major.JXGCJZDH,CoursesType.BI_XIU),
	ZHIZHAOGONGCHENG_JICHU("0411","制造工程基础",Major.JXGCJZDH,CoursesType.BI_XIU),
	JIDIANKONGZHI_GONGCHENG("0412","机电控制工程",Major.JXGCJZDH,CoursesType.BI_XIU),
	JIANCE_JISHU("0413","检测技术",Major.JXGCJZDH,CoursesType.BI_XIU),
	WEIJIYUANLI_YU_JIKOU_JISHU("0414","微机原理与接口技术",Major.JXGCJZDH,CoursesType.BI_XIU),
	RUANJIAN_JISHU_JICHU("0415","软件技术基础",Major.JXGCJZDH,CoursesType.BI_XIU),
	
	/*制造自动化与测控技术必修课*/
	XIANDAI("0501","线代",Major.ZZJZDH,CoursesType.BI_XIU),
	FUBIAN_HANSHU_YU_JIFEN_BIANHUAN("0502","复变函数与积分变换",Major.ZZJZDH,CoursesType.BI_XIU),
	GAILVLUN("0503","概率论",Major.ZZJZDH,CoursesType.BI_XIU),
	C_YUYAN("0504","C语言",Major.ZZJZDH,CoursesType.BI_XIU),
	JISUANJI_WANGLUO_ZZJZDH("0505","计算机网络",Major.ZZJZDH,CoursesType.BI_XIU),
	DAXUE_WULI("0506","大学物理",Major.ZZJZDH,CoursesType.BI_XIU),
	YINGYONG_GUANXUE("0507","应用光学",Major.ZZJZDH,CoursesType.BI_XIU),
	WULI_GUANGXUE("0508","物理光学",Major.ZZJZDH,CoursesType.BI_XIU),
	GUANGXUE_SHEJI("0509","光学设计",Major.ZZJZDH,CoursesType.BI_XIU),
	
	/*车辆工程必修课*/
	LIXUE("0601","力学",Major.CLGC,CoursesType.BI_XIU),
	CHELIANG_GONGCHENG("0602","车辆工程",Major.CLGC,CoursesType.BI_XIU),
	JISUANJI_JISHU("0603","计算机技术",Major.CLGC,CoursesType.BI_XIU),
	DAXUE_YINGYU_CLGC("0604","大学英语",Major.CLGC,CoursesType.BI_XIU),
	GAODENG_SHUXUE("0605","高等数学",Major.CLGC,CoursesType.BI_XIU),
	JIXIE_ZHITU("0606","机械制图",Major.CLGC,CoursesType.BI_XIU),
	LILUN_LIXUE_CLGC("0607","理论力学",Major.CLGC,CoursesType.BI_XIU),
	CAILIAO_LIXUE_CLGC("0608","材料力学",Major.CLGC,CoursesType.BI_XIU),
	NEIRANJI_LILUN("0609","内燃机理论",Major.CLGC,CoursesType.BI_XIU),
	
	/*临床医学的必修课*/
	YXWL("0701","医学物理学",Major.LCYX,CoursesType.BI_XIU),
	YXSW("0702","医学生物学",Major.LCYX,CoursesType.BI_XIU),
	XTJP("0703","系统解剖学",Major.LCYX,CoursesType.BI_XIU),
	ZJJPX("0704","局部解剖学",Major.LCYX,CoursesType.BI_XIU),
	ZJYPTX("0705","组织学与胚胎学",Major.LCYX,CoursesType.BI_XIU),
	YLX("0706"," 药理学",Major.LCYX,CoursesType.BI_XIU),
	
	/*计算机软件的必修课*/
	JSJJC("0901","计算机基础",Major.JSJRJ,CoursesType.BI_XIU),
	JSJZBCL("0902","计算机字表处理",Major.JSJRJ,CoursesType.BI_XIU),
	BASIC("0903","BASIC语言",Major.JSJRJ,CoursesType.BI_XIU),
	BGRJ("0904","办公软件",Major.JSJRJ,CoursesType.BI_XIU),
	SJKYYJC("0905","数据库应用基础",Major.JSJRJ,CoursesType.BI_XIU),
	WJYL("0906","微机原理",Major.JSJRJ,CoursesType.BI_XIU),
	WYZZ("0907","网页制作",Major.JSJRJ,CoursesType.BI_XIU),
	
	/*电气工程及自动化必修课*/
	DL("1001","电路",Major.DQGCJZDH,CoursesType.BI_XIU),
	DZJSJC("1002","电子技术基础",Major.DQGCJZDH,CoursesType.BI_XIU),
	DJX("1003","电机学",Major.DQGCJZDH,CoursesType.BI_XIU),
	JSJZCJS("1004","计算机组成技术",Major.DQGCJZDH,CoursesType.BI_XIU),
	ZDKZLL("1005","自动控制理论",Major.DQGCJZDH,CoursesType.BI_XIU),
	JSJFZJS("1006","计算机仿真技术",Major.DQGCJZDH,CoursesType.BI_XIU),
	
	/*部分选修课*/
	JSLL("1101","军事理论",Major.DQGCJZDH,CoursesType.XUAN_XIU),
	MZDSX("1102","毛泽东思想概论",Major.JSJRJ,CoursesType.XUAN_XIU),
	DXPLL("1103","邓小平理论",Major.LCYX,CoursesType.XUAN_XIU),
	TSSCJS("1104","唐宋诗词鉴赏",Major.CLGC,CoursesType.XUAN_XIU),
	XFZX("1105","西方哲学",Major.ZZJZDH,CoursesType.XUAN_XIU),
	RTGZYJK("1106","人体构造与健康",Major.LCYX,CoursesType.XUAN_XIU),
	;
	
	private String code;
	private String name;
	private Major major;
	private CoursesType type;
	private Courses(String code, String name, Major major, CoursesType type)
	{
		this.code = code;
		this.name = name;
		this.major = major;
		this.type = type;
	}
	

	public static List<Courses> queryCourseByMajorCodeAndCoursesType(String majorCode,String typeCode)
	{
		List<Courses> result = new ArrayList<Courses>();
		for(Courses c : Courses.values())
		{
			if(majorCode==null&&typeCode==null)
			{
				return Arrays.asList(Courses.values());
			}else if(majorCode!=null&&typeCode!=null)
			{
				if(majorCode.equals(c.getMajor().getClass())&&typeCode.equals(c.getType().getCode()))
				{
					result.add(c);
				}
			}else if(majorCode!=null&&typeCode==null)
			{
				if(majorCode.equals(c.getMajor().getCode()))
				{
					result.add(c);
				}
			}else if(majorCode==null&&typeCode!=null)
			{
				if(typeCode.equals(c.getType().getCode()))
				{
					result.add(c);
				}
			}
		}
		Logger.debug(Courses.class, String.format("excete queryCourseByMajorCodeAndCoursesType method return list.size:%s", result.size()));
		return result;
	}

    public static Courses findByCode(String code)
    {
        for(Courses c : Courses.values())
        {
            if(c.getCode().equals(code))
            {
                Logger.debug(Courses.class,String.format("get courses by code [code:%s]",code));
                return c;
            }
        }
        return null;
    }

	public String getCode()
	{
		return code;
	}
	public void setCode(String code)
	{
		this.code = code;
	}
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	public Major getMajor()
	{
		return major;
	}
	public void setMajor(Major major)
	{
		this.major = major;
	}
	public CoursesType getType()
	{
		return type;
	}
	public void setType(CoursesType type)
	{
		this.type = type;
	}
	
	
}
